{{ define "main" }}
{{ $paginator := .Paginate (where .Site.RegularPages "Section" "post").ByPublishDate.Reverse }}
<div class="container">
    <div class="columns">
        <div class="is-9">
            <div class="tile is-child">
                <div class="content">
                    {{ range $paginator.Pages }}
                        <article class="article">
                            <div class="article_left">
                                <a href="{{ .Permalink }}"><img src="{{ .Params.img }}"></a>
                            </div>

                            <div class="article_right">
                                <a href="{{ .Permalink }}"><h3>{{ .LinkTitle }}</h3></a>
                                <div>
                                    <span class="article_right_author">{{ .Params.author }}</span>
                                    {{ partial "svgs/ico_date.svg" }}
                                    <span class="article_right_date">{{ .Date.Format "2006-01-02" }}</span>
                                    {{ partial "svgs/ico_read.svg" }}
                                    <span id="{{ .Permalink | relURL }}" class="leancloud_visitors" data-flag-title="{{ .LinkTitle }}">
                                        <i class="leancloud-visitors-count"></i>                     
                                    </span>
                                </div>
                                <a href="{{ .Permalink }}"><p>{{ .Params.summary }}...</p></a>
                            </div>
                        </article>
                    {{ end }}
                </div>
            </div>
        </div>
        <div class="column is-3 isPc">
            {{ partial "widget-tags.html" . }}<br>
            {{ partial "widget-recent.html" . }}<br>
            {{ partial "widget-archives.html" . }}
        </div>
    </div>
    <div class="columns">
        <div class="column is-9">
            <nav class="pagination is-centered is-rounded" role="navigation" aria-label="pagination">
                {{ if $paginator.HasPrev }}<a class="pagination-previous" href="{{ $paginator.Prev.URL }}">{{ i18n "main_cards_previous" }}</a>{{ end }}
                {{ if $paginator.HasNext }}<a class="pagination-next" href="{{ $paginator.Next.URL }}">{{ i18n "main_cards_next" }}</a>{{ end }}
                <ul class="pagination-list">
                    {{ range $paginator.Pagers }}
                    <li class="pagination__item">
                        <a class="pagination-link{{ if eq . $paginator }} is-current{{ end }}" aria-label="Goto page {{ .PageNumber }}" href="{{ .URL }}">{{ .PageNumber }}</a>
                    </li>
                    {{ end }}
                </ul>
            </nav>
        </div>
    </div>
</div>

{{ end }}
